import axios from '@/libs/api.request';
import {
  order
} from './resetApi';

/**
 * 订单报表
 * @param {*} params {
  "beginTime": "string",
  "cashierCode": "string",
  "cashierName": "string",
  "endTime": "string",
  "orderNo": "string",
  "page": 0,
  "pageSize": 0,
  "storeCode": "string"}
 */
export const chainOrderFlow = params => {
  return axios.request({
    url: order.chainOrderFlow,
    method: 'post',
    data: params
  })
};

/**
 * 订单报表合计
 * @param {*} params {
  "beginTime": "string",
  "cashierCode": "string",
  "cashierName": "string",
  "endTime": "string",
  "orderNo": "string",
  "page": 0,
  "pageSize": 0,
  "storeCode": "string"}
 */
export const chainOrderFlowToal = params => {
  return axios.request({
    url: order.chainOrderFlowToal,
    method: 'post',
    data: params
  })
};
/**
 * 导出订单汇总统计报表
 * @param {*} data
 */
export const chainOrderExportFlowExcel = (data) => {
  return axios.request({
    url: order.chainExportFlowExcel,
    method: 'post',
    responseType: 'blob',
    data: data
  })
};
/**
 * 查询付款统计报表
 * @param {*} params {
  "beginTime": "string",
  "endTime": "string"}
 */
export const chainOrderPayModeStatistics = params => {
  return axios.request({
    url: order.chainOrderPayModeStatistics,
    method: 'post',
    data: params
  })
};
/**
 * 导出实收统计报表
 * @param {*} data
 */
export const chainOrderExportPayModeExcel = (data) => {
  return axios.request({
    url: order.chainExportPayModeExcel,
    method: 'post',
    responseType: 'blob',
    data: data
  })
};
/**
 * 订单报表
 * @param {*} params {
  "beginTime": "string",
  "cashierCode": "string",
  "cashierName": "string",
  "endTime": "string",
  "orderNo": "string",
  "page": 0,
  "pageSize": 0,
  "storeCode": "string"}
 */
export const orderFlow = params => {
  return axios.request({
    url: order.orderFlow,
    method: 'post',
    data: params
  })
};

/**
 * 退货订单列表
 * @param {*} params {
  "beginTime": "string",
  "endTime": "string",
  "refundMode": "string",
  "cashierCode": "string",
  "returnType": "string",
  "orderNo": "string",
  "refundNo": "string",
  "productBarcode": "string",
  "page": 0,
  "pageSize": 0,
  }
 */
export const returnOrderFlow = params => {
  return axios.request({
    url: order.refundOrderFlow,
    method: 'post',
    data: params
  })
};

/**
 * 退货订单详情
 * @param {*} params {
  "orderNo": "string",
  }
 */
export const returnOrderDetail = params => {
  return axios.request({
    url: order.refundOrderDetail,
    method: 'get',
    params: params
  })
};

/**
 * 订单报表合计
 * @param {*} params {
  "beginTime": "string",
  "cashierCode": "string",
  "cashierName": "string",
  "endTime": "string",
  "orderNo": "string",
  "page": 0,
  "pageSize": 0,
  "storeCode": "string"}
 */
export const orderFlowToal = params => {
  return axios.request({
    url: order.orderFlowToal,
    method: 'post',
    data: params
  })
};

/**
 * 商品销售排行
 * @param {*} params {
  "beginTime": "string",
  "classCode": "string",
  "colorCode": "string",
  "endTime": "string",
  "page": 0,
  "pageSize": 0,
  "sizeCode": "string",
  "storeCode": "string"}
 */
export const orderRanking = params => {
  return axios.request({
    url: order.orderRanking,
    method: 'post',
    data: params
  })
};

/**
 * 商品销售排行合计
 * @param {*} params {
  "beginTime": "string",
  "cashierCode": "string",
  "cashierName": "string",
  "endTime": "string",
  "orderNo": "string",
  "page": 0,
  "pageSize": 0,
  "storeCode": "string"}
 */
export const orderRankingTotal = params => {
  return axios.request({
    url: order.orderRankingTotal,
    method: 'post',
    data: params
  })
};

/**
 * 订单明细
 * @param {*} params {
  "beginTime": "string",
  "cashierCode": "string",
  "cashierName": "string",
  "classCode": "string",
  "colorCode": "string",
  "endTime": "string",
  "orderNo": "string",
  "page": 0,
  "pageSize": 0,
  "productBarcode": "string",
  "productCode": "string",
  "productEnglishName": "string",
  "productName": "string",
  "sizeCode": "string",
  "storeCode": "string"}
 */
export const chainOrderDetail = params => {
  return axios.request({
    url: order.chainOrderDetail,
    method: 'post',
    data: params
  })
};

/**
 * 商品销售排行合计
 * @param {*} params {
  "beginTime": "string",
  "cashierCode": "string",
  "cashierName": "string",
  "classCode": "string",
  "colorCode": "string",
  "endTime": "string",
  "orderNo": "string",
  "page": 0,
  "pageSize": 0,
  "productBarcode": "string",
  "productCode": "string",
  "productEnglishName": "string",
  "productName": "string",
  "sizeCode": "string",
  "storeCode": "string"
  }
 */
export const chainOrderDetailTotal = params => {
  return axios.request({
    url: order.chainOrderDetailTotal,
    method: 'post',
    data: params
  })
};

/**
 * 导出订单明细报表
 * @param {*} data
 */
export const chainOrderExportOrderDetailExcel = (data) => {
  return axios.request({
    url: order.chainExportOrderDetailExcel,
    method: 'post',
    responseType: 'blob',
    data: data
  })
};

/**
 * 商品分类排行
 * @param {*} params {
  "beginTime": "string",
  "endTime": "string",
  "page": 0,
  "pageSize": 0,
  "storeCode": "string"}
 */
export const orderClassRanking = params => {
  return axios.request({
    url: order.orderClassRanking,
    method: 'post',
    data: params
  })
};

/**
 * 商品销售排行合计
 * @param {*} params {
  "beginTime": "string",
  "endTime": "string",
  "page": 0,
  "pageSize": 0,
  "storeCode": "string"}
 */
export const orderClassRankingTotal = params => {
  return axios.request({
    url: order.orderClassRankingTotal,
    method: 'post',
    data: params
  })
};

/**
 * 订单明细
 * @param {*} params {
  "beginTime": "string",
  "cashierCode": "string",
  "cashierName": "string",
  "classCode": "string",
  "colorCode": "string",
  "endTime": "string",
  "orderNo": "string",
  "page": 0,
  "pageSize": 0,
  "productBarcode": "string",
  "productCode": "string",
  "productEnglishName": "string",
  "productName": "string",
  "sizeCode": "string",
  "storeCode": "string"}
 */
export const orderDetail = params => {
  return axios.request({
    url: order.orderDetail,
    method: 'post',
    data: params
  })
};

/**
 * 商品销售排行合计
 * @param {*} params {
  "beginTime": "string",
  "cashierCode": "string",
  "cashierName": "string",
  "classCode": "string",
  "colorCode": "string",
  "endTime": "string",
  "orderNo": "string",
  "page": 0,
  "pageSize": 0,
  "productBarcode": "string",
  "productCode": "string",
  "productEnglishName": "string",
  "productName": "string",
  "sizeCode": "string",
  "storeCode": "string"
  }
 */
export const orderDetailTotal = params => {
  return axios.request({
    url: order.orderDetailTotal,
    method: 'post',
    data: params
  })
};

/**
 * 运营统计
 * @param {*} params {
  "beginTime": "string",
  "endTime": "string"}
 */
export const chainOrderOperateStatistics = params => {
  return axios.request({
    url: order.chainOrderOperateStatistics,
    method: 'post',
    data: params
  })
};

/**
 * 导出营运统计报表
 * @param {*} data
 */
export const chainOrderExportOperateStatisticsExcel = (data) => {
  return axios.request({
    url: order.chainExportOperateStatisticsExcel,
    method: 'post',
    responseType: 'blob',
    data: data
  })
};

/**
 * 异常订单汇总
 * @param {*} params {
  "beginTime": "string",
  "cashierCode": "string",
  "cashierName": "string",
  "endTime": "string",
  "orderNo": "string",
  "page": 0,
  "pageSize": 0,
  "storeCode": "string"}
 */
export const orderFlowAbnormal = params => {
  return axios.request({
    url: order.orderFlowAbnormal,
    method: 'post',
    data: params
  })
};

/**
 * 异常订单汇总合计
 * @param {*} params {
 "beginTime": "string",
  "cashierCode": "string",
  "cashierName": "string",
  "endTime": "string",
  "orderNo": "string",
  "page": 0,
  "pageSize": 0,
  "storeCode": "string"}
 */
export const orderFlowAbnormalToal = params => {
  return axios.request({
    url: order.orderFlowAbnormalToal,
    method: 'post',
    data: params
  })
};

/**
 * 运营统计
 * @param {*} params {
  "beginTime": "string",
  "endTime": "string"}
 */
export const orderOperateStatistics = params => {
  return axios.request({
    url: order.orderOperateStatistics,
    method: 'post',
    data: params
  })
};

/**
 * 利润表交易日期时间范围查询
 * @param {*} params {
  "beginDate": "string",
  "endDate": "string"}
 */
export const incomeStatement = params => {
  return axios.request({
    url: order.incomeStatement,
    method: 'post',
    data: params
  })
};
//

/**
 * 利润表交易日期时间返回汇总查询
 * @param {*} params {
  "beginDate": "string",
  "endDate": "string"}
 */
export const summarizing = params => {
  return axios.request({
    url: order.summarizing,
    method: 'post',
    data: params
  })
};

/**
 * 利润表商品编码维度日期查询(查询明细)
 * @param {*} params {
  "beginDate": "string",
  "endDate": "string"}
 */
export const queryDetails = params => {
  return axios.request({
    url: order.queryDetails,
    method: 'post',
    data: params
  })
};
/**
 * 利润表商品编码维护日期查询汇总
 * @param {*} params {
  "beginDate": "string",
  "endDate": "string"}
 */
export const codeMaintenance = params => {
  return axios.request({
    url: order.codeMaintenance,
    method: 'post',
    data: params
  })
};

export const orderPayModeStatistics = params => {
  return axios.request({
    url: order.orderPayModeStatistics,
    method: 'post',
    data: params
  })
};
/**
 * 今日付款方式饼图
 */
export const orderTodayPayMode = () => {
  return axios.request({
    url: order.todayPayMode,
    method: 'get'
  })
};
/**
 * 近七天销售额
 */
export const orderSale7Total = () => {
  return axios.request({
    url: order.sale7Total,
    method: 'get'
  })
};
/**
 * 今日销售数据
 */
export const orderTodaySale = () => {
  return axios.request({
    url: order.todaySale,
    method: 'get'
  })
};
export const openCardCount = (data) => {
  return axios.request({
    url: order.openCardCount,
    method: 'post',
    data: data
  })
}
/**
 * 导出订单汇总统计报表
 * @param {*} data
 */
export const orderExportFlowExcel = (data) => {
  return axios.request({
    url: order.exportFlowExcel,
    method: 'post',
    responseType: 'blob',
    data: data
  })
};
/**
 * 出商品分类销售排行统计报表
 * @param {*} data
 */
export const orderExportGoodsClassSaleRankingExcel = (data) => {
  return axios.request({
    url: order.exportGoodsClassSaleRankingExcel,
    method: 'post',
    responseType: 'blob',
    data: data
  })
};
/**
 * 导出商品销售排行统计报表
 * @param {*} data
 */
export const orderExportGoodsSaleRankingExcel = (data) => {
  return axios.request({
    url: order.exportGoodsSaleRankingExcel,
    method: 'post',
    responseType: 'blob',
    data: data
  })
};
/**
 * 导出订单明细报表
 * @param {*} data
 */
export const orderExportOrderDetailExcel = (data) => {
  return axios.request({
    url: order.exportOrderDetailExcel,
    method: 'post',
    responseType: 'blob',
    data: data
  })
};
/**
 * 查询会员余额充值消费记录列表
 * @param {*} data
 */
export const chainMembershipBalanceRecord = (data) => {
  return axios.request({
    url: order.chainMembershipBalanceRecord,
    method: 'post',
    data: data
  })
};
/**
 * 导出会员余额充值消费记录报表
 * @param {*} data
 */
export const chainExportMembershipBalanceRecordExcel = (data) => {
  return axios.request({
    url: order.chainExportMembershipBalanceRecordExcel,
    method: 'post',
    responseType: 'blob',
    data: data
  })
};
/**
 * 导出异常订单报表
 * @param {*} data
 */
export const orderExportAbnormalExcel = (data) => {
  return axios.request({
    url: order.exportAbnormalExcel,
    method: 'post',
    responseType: 'blob',
    data: data
  })
};
/**
 * 导出营运统计报表
 * @param {*} data
 */
export const orderExportOperateStatisticsExcel = (data) => {
  return axios.request({
    url: order.exportOperateStatisticsExcel,
    method: 'post',
    responseType: 'blob',
    data: data
  })
};
/**
 * 导出实收统计报表
 * @param {*} data
 */
export const orderExportPayModeExcel = (data) => {
  return axios.request({
    url: order.exportPayModeExcel,
    method: 'post',
    responseType: 'blob',
    data: data
  })
};
/**
 * 查询会员余额充值消费记录列表
 * @param {*} data
 */
export const membershipBalanceRecord = (data) => {
  return axios.request({
    url: order.membershipBalanceRecord,
    method: 'post',
    data: data
  })
};
/**
 * 导出会员余额充值消费记录报表
 * @param {*} data
 */
export const exportMembershipBalanceRecordExcel = (data) => {
  return axios.request({
    url: order.exportMembershipBalanceRecordExcel,
    method: 'post',
    responseType: 'blob',
    data: data
  })
};
/**
 * 获取会员卡类信息
 * @param {*} data
 */
export const cardTypeList = (data) => {
  return axios.request({
    url: order.cardTypeList,
    method: 'post',
    data: data
  })
};

/**
 * 获取会员卡类信息
 * @param {*} data
 */
export const chainCardTypeList = (data) => {
  return axios.request({
    url: order.chainCardTypeList,
    method: 'post',
    data: data
  })
};

/**
 * 单店-保存/更新活动
 * @param {*} data
 */
export const storeActivityManageSave = (data) => {
  return axios.request({
    url: order.storeActivityManageSave,
    method: 'post',
    data: data
  })
};

/**
 * 单店-更新活动状态
 * @param {*} data
 */
export const storeActivityManageUpdateStatus = (params) => {
  return axios.request({
    url: order.storeActivityManageUpdateStatus,
    method: 'get',
    params: params
  })
};

/**
 * 单店-查询活动详情
 * @param {*} data
 */
export const storeActivityManageDetail = (params) => {
  return axios.request({
    url: order.storeActivityManageDetail,
    method: 'get',
    params: params
  })
};

/**
 * 单店-分页查询活动列表
 * @param {*} data
 */
export const storeActivityManageListPage = (data) => {
  return axios.request({
    url: order.storeActivityManageListPage,
    method: 'post',
    data: data
  })
};

/**
 * 连锁-保存/更新活动
 * @param {*} data
 */
export const chainActivityManageSave = (data) => {
  return axios.request({
    url: order.chainActivityManageSave,
    method: 'post',
    data: data
  })
};

/**
 * 连锁-发布活动
 * @param {*} data
 */
export const chainActivityManageDistribute = (data) => {
  return axios.request({
    url: order.chainActivityManageDistribute,
    method: 'post',
    data: data
  })
};

/**
 * 连锁-活动门店查询
 * @param {*} data
 */
export const chainActivityStoreQuery = (params) => {
  return axios.request({
    url: order.chainActivityStoreQuery,
    method: 'get',
    params: params
  })
};

/**
 * 连锁-分页查询活动列表
 * @param {*} data
 */
export const chainActivityManageListPage = (data) => {
  return axios.request({
    url: order.chainActivityManageListPage,
    method: 'post',
    data: data
  })
};

/**
 * 连锁-查询活动详情
 * @param {*} data
 */
export const chainActivityManageDetail = (params) => {
  return axios.request({
    url: order.chainActivityManageDetail,
    method: 'get',
    params: params
  })
};

/**
 * 连锁-撤回活动下发
 * @param {*} data
 */
export const activityManageUnSubScribe = (params) => {
  return axios.request({
    url: order.activityManageUnSubScribe,
    method: 'get',
    params: params
  })
};

/**
 * 连锁-活动效果-活动分析
 * @param {*} data
 */
export const chainActivityStatisticsInfo = (data) => {
  return axios.request({
    url: order.chainActivityStatisticsInfo,
    method: 'post',
    data: data
  })
};

/**
 * 连锁-活动效果-活动营业额排行榜
 * @param {*} data
 */
export const chainActivityStatisticsStoreChart = (data) => {
  return axios.request({
    url: order.chainActivityStatisticsStoreChart,
    method: 'post',
    data: data
  })
};

/**
 * 连锁-查询活动关联门店列表
 * @param {*} data
 */
export const chainActivityStatisticsStoreList = (params) => {
  return axios.request({
    url: order.chainActivityStatisticsStoreList,
    method: 'get',
    params: params
  })
};

/**
 * 删除活动
 * @param {*} data
 */
export const activityManageDelete = (params) => {
  return axios.request({
    url: order.activityManageDelete,
    method: 'get',
    params: params
  })
};
